import {http} from "@/http/http";
import { addAddressModel, returnAdd, getAddressInfo, AddressTs } from "./types/address";

export function getOrderAddress() {
  return http.Get<AddressTs>('/patient/order/address')
}

export function editAddress({ id, data }: { id: string, data: addAddressModel }) {
  return http.Put<returnAdd>(`/patient/order/address/${id}`, data)
}

export function addAddress(data: addAddressModel) {
  return http.Post<returnAdd>('/patient/order/address', data)
}

export function getAddressInfo(id: string) {
  return http.Get<getAddressInfo>(`/patient/order/address/${id}`)
}

export function delAddress(id: string) {
  return http.Delete<returnAdd>(`/patient/order/address/${id}`)
}